package edu.scau.mis.pos.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import edu.scau.mis.core.domain.BaseEntity;
import jakarta.validation.constraints.DecimalMax;
import jakarta.validation.constraints.DecimalMin;
import jakarta.validation.constraints.Min;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;

@Data
public class Promotion extends BaseEntity {
    private String promotionId;
    private String promotionName;
    private String promotionType; // Discount, FullReduce, Original
    private Integer status;
    private String content;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
    private Date startDate;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
    private Date endDate;
    @DecimalMin(value = "0.01", message = "折扣必须大于0")
    @DecimalMax(value = "1.00", message = "折扣不能大于1")
    private BigDecimal discount;
    @Min(value = 0, message = "满减金额不能为负数")
    private Integer minAmount;
    @Min(value = 0, message = "减免金额不能为负数")
    private Integer reduceAmount;

    public String getPromotionId() {
        return promotionId;
    }

    public void setPromotionId(String promotionId) {
        this.promotionId = promotionId;
    }

    public String getPromotionName() {
        return promotionName;
    }

    public void setPromotionName(String promotionName) {
        this.promotionName = promotionName;
    }

    public String getPromotionType() {
        return promotionType;
    }

    public void setPromotionType(String promotionType) {
        this.promotionType = promotionType;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public Date getStartDate() {
        return startDate;
    }

    public void setStartDate(Date startDate) {
        this.startDate = startDate;
    }

    public Date getEndDate() {
        return endDate;
    }

    public void setEndDate(Date endDate) {
        this.endDate = endDate;
    }

    public BigDecimal getDiscount() {
        return discount;
    }

    public void setDiscount(BigDecimal discount) {
        this.discount = discount;
    }

    public Integer getMinAmount() {
        return minAmount;
    }

    public void setMinAmount(Integer minAmount) {
        this.minAmount = minAmount;
    }

    public Integer getReduceAmount() {
        return reduceAmount;
    }

    public void setReduceAmount(Integer reduceAmount) {
        this.reduceAmount = reduceAmount;
    }
}